import { ResPage, User } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 模块名 请求模板
 */
// post请求传参
export const postFun = (params: User.ReqUserParams) => {
  return http.post<ResPage<User.ResUserList>>({
    url: PORT1 + `/user/list`,
    data: params
  });
};

// download请求传参
export const downloadFun = (params: User.ReqUserParams) => {
  return http.download({
    url: PORT1 + `/user/export`,
    params
  });
};

// get请求传参
export const getFun = () => {
  return http.get<User.ResDepartment[]>({
    url: PORT1 + `/user/department`,
    params: {},
    _object: { cancel: false }
  });
};

// put请求传参
export const putFun = () => {
  return http.put<User.ResRole[]>({
    url: PORT1 + `/user/role`,
    params: {},
    _object: { cancel: false }
  });
};

// delete请求传参
export const deleteFun = () => {
  return http.delete<User.ResRole[]>({
    url: PORT1 + `/user/role`,
    params: {},
    _object: { cancel: false }
  });
};
